package com.ant.storage.service;

import com.ant.storage.common.ResultVo;
import com.ant.storage.dto.MonthlyDto;
import com.ant.storage.dto.MonthlySettlementDto;
import com.ant.storage.dto.PurchaserRecordDto;
import com.ant.storage.dto.RecordDto;
import com.ant.storage.pojo.AuditList;
import com.ant.storage.pojo.PurchaserRecord;
import com.ant.storage.pojo.SupplierInformation;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import org.springframework.validation.BindingResult;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author melon
 * @since 2022-04-13
 */
public interface IPurchaserRecordService extends IService<PurchaserRecord> {

    ResultVo purchaserRecordSettlement(PurchaserRecordDto purchaserRecordDto, BindingResult bindingResult);

    /**
     * 获取采购单结算申请列表
     * @param dto
     * @return
     */
    PageInfo<PurchaserRecord> getApplySettlement(PurchaserRecordDto dto);

    ResultVo getApplySettlementsById(Integer id,String purchaseType);

    ResultVo getApplyAdopt(PurchaserRecordDto dto);

    PageInfo<SupplierInformation> getSupplierInformation(MonthlyDto dto);

    /**
     * 财务获取月结申请
     * @param dto
     * @return
     */
    PageInfo<PurchaserRecord> getMonthlyApplySettlement(PurchaserRecordDto dto);

    /**
     * 月结申请 同意结算
     * @param dto
     * @return
     */
    ResultVo MonthlySettlementAdopt(MonthlySettlementDto dto);


    /**
     * 通过id获取结算单详情
     * @param id
     * @return
     */
    ResultVo getSettlementsById(Integer id);

    //ResultVo test(PurchaserRecordDto purchaserRecordDto, BindingResult bindingResult) throws Exception;

    /**
     * 月结申请提交
     * @param purchaserRecordDto
     * @param bindingResult
     * @return
     */
    ResultVo MonthlySettlementSave(PurchaserRecordDto purchaserRecordDto, BindingResult bindingResult);

    /**
     * 合并报销
     * @param dto
     * @param bindingResult
     * @return
     */
    ResultVo mergeSettlement(PurchaserRecordDto dto, BindingResult bindingResult);

    ResultVo mergeSettlements(PurchaserRecordDto dto, BindingResult bindingResult);

    /**
     * 小程序获取报销记录
     * @param userId
     * @return
     */
    PageInfo<PurchaserRecord> getSettlementRecord(RecordDto userId);

    AuditList selectIsAudit(String processInstanceId, String user_id);

    void recordApproved(String processInstanceId, String opinion);

    ResultVo RsendDingTalks(Integer id,Integer uid) throws Exception;

    ResultVo getPurchaserRecordById(Integer id);

    ResultVo syncDingTalk(Integer id);

    ResultVo revoke(Integer id);
}
